# /bin/bash

host_ip=$(ip addr show | grep ens | grep -E 'inet [0-9]' | awk '{print $2}' | awk -F '/' '{print $1}')
if [ ! $host_ip ]; then
  host_ip=$(ip addr show | grep enp | grep -E 'inet [0-9]' | awk '{print $2}' | awk -F '/' '{print $1}')
fi
if [ ! $host_ip ]; then
  host_ip=$(ip addr show | grep eth | grep -E 'inet [0-9]' | awk '{print $2}' | awk -F '/' '{print $1}')
fi

export HOST_IP=$host_ip
docker-compose down
docker-compose up -d
